package q167_twoSum;

public class Solution_1 {
    /*
    两次遍历
    暴力解法 但是时间复杂度到达n方
     */
    public int[] twoSum(int[] numbers, int target) {
        // int[] ans = new int[2];
        for (int i = 0; i < numbers.length; i++) {
            for (int j = i + 1; j < numbers.length; j++) {
                if (numbers[j] + numbers[i] == target) {
                    return new int[] {
                        i,j
                    };
                }
            }
        }
        return new int[2];
    }
}
